'use strict';

module.exports = {
  up: (queryInterface, Sequelize) => {
    /*
      Add altering commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.createTable('users', { id: Sequelize.INTEGER });
    */

      const { STRING, INTEGER, DATE,BOOLEAN } = Sequelize;

      return queryInterface.createTable('users', {
          id: { type: INTEGER, primaryKey: true, autoIncrement: true },
          user_name:{type:STRING(30),unique:true,allowNull:false},
          user_password:{type:STRING(64),allowNull:false},
          name:{type:STRING(30),allowNull:false},
          mobile:{type:STRING(15),unique:true,allowNull:false},
          email:{type:STRING(100),unique:true,allowNull:false},
          is_use:{type:BOOLEAN,defaultValue:true},
          created_at: DATE,
          updated_at: DATE,
      });
  },

  down: (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.dropTable('users');
    */

      return queryInterface.dropTable('users');
  }
};
